data = load('data.csv');
s=size(data);
Seg = 2;

A1 = zeros(Seg,1);
A1(1,1) = 300;
A1(2,1) = 200;

A2 = s(1,1);
A3 = s(1,1);

k1=rand(A1,Seg);
k2=rand(A2,1);
k3=rand(A3,1);
ic1=ones(A1,Sef);
ic2=data(:,5);
ic3=data(:,5);

for i = 1:Seg
	per1=k1(.*ic1;
per2=k2.*ic2;
per3=k3.*ic3;

per1=per1.*10;
per2=per2.*10;
per3=per3.*10;

Hist=1000;
P=zeros(Hist,1);
P(1)=100;
PU=zeros(Seg,1);
PU(1,1)=105;
PL=95;

for i=1:Hist-1

a1B=max(per1);
a1S=min(per1);
a2=max(per2);
a3=min(per3);

X=rand(1);

if P(i)<PU && P(i)>PL

if rand(1) > 0.5
P(i+1)=P(i)+X;
else
P(i+1)=P(i)-X;
end;

else 

if P(i)>PU
P(i+1)=P(i)-X;

else
P(i+1)=P(i)+X;

end;

end;


end;

plot(P);





